package brands

import (
	"context"
	"device_srv/device"
	"device_srv/internal/dao"
	"device_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type BrandsUpdateLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewBrandsUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BrandsUpdateLogic {
	return &BrandsUpdateLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// BrandsUpdate 品牌信息修改
func (l *BrandsUpdateLogic) BrandsUpdate(in *device.BrandsUpdateRequest) (*device.BrandsUpdateResponse, error) {
	//调用业务逻辑
	update, err := dao.BrandsUpdate(in)
	if err != nil {
		return nil, err
	}
	return &device.BrandsUpdateResponse{
		Id: int64(update.Id),
	}, nil
}
